<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div></div>
</body>
</html>
<script>
    var div=document.querySelector('div');
    div.setAttribute('flag',2)
    div.setAttribute('id',2)
</script>